FROM python:3.7.1-alpine3.8
MAINTAINER mingrui1
RUN mkdir /code
RUN mkdir /log
COPY . /code/
RUN echo "https://mirror.tuna.tsinghua.edu.cn/alpine/v3.8/main/" > /etc/apk/repositories
RUN apk add gcc musl-dev tzdata
RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone
RUN pip install -r /code/requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
RUN pip install /code/lib/mysql-connector-python-2.1.8.zip
WORKDIR /code
ENV MIGONG=PRODUCTION
CMD ["gunicorn", "app:app","-c", "gunicorn.conf.py"]